#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
typedef struct
{
    string name;
    int height;
}pp;

class Compare
{
public:
    bool operator()(pp& a, pp& b)
    {
        return a.height > b.height;
    }
};
class Solution
{
public:
    vector<string> sortPeople(vector<string>& names, vector<int>& heights)
    {
        int n = names.size();
        vector<pp> arr(n);
        for (int i = 0; i < n; i++)
        {
            arr[i] = { names[i],heights[i] };
        }
        sort(arr.begin(), arr.end(), Compare());
        vector<string> ret;
        for (int i = 0; i < arr.size(); i++)
        {
            ret.push_back(arr[i].name);
        }
        return ret;
    }
};

